import Vue from 'vue'
import Vuex from 'vuex'
import { clearCookies } from "@/utils/cookie";
Vue.use(Vuex)
const initState = () => {
  return {
    equipment: "",
    color: 'red'
  };
};

const state = initState();

const mutations = {
  //获取当前设备
  getCurrentEquipment(state, payload) {
    state.equipment = payload
  },

  resetState(state) {
    Object.assign(state, initState());
  },
  changHome(state) {
    state.color = 'home'
  }
};

const actions = {}

const getters = {};

export default new Vuex.Store({
  state, // 状态
  mutations, // 包含多个更新state函数的对象
  actions, // 包含多个队形事件回调函数的对象
  getters, // 包含多个getter计算属性函数的对象
})
